package sql;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

import sql.SQLConnection;

public class Test {
/**
 * 
 * @return
 * @throws SQLException
 */
	public String  fun1() throws SQLException
	{
		
		try 
		{

			System.out.println("getting book detail for viewing");
			Statement stmt;
			SQLConnection conn = new  SQLConnection();
			stmt = conn.getConnection().createStatement();
			
			ResultSet rs= stmt.executeQuery("SELECT * FROM db1.bookscopies;");
		}
  
		catch (Exception ex )
		{
	  ex.printStackTrace();
		}
		return "ok";
	}
	public String  fun2() throws SQLException
	{
		
		try 
		{

			System.out.println("Getting subscriber detail for viewing");
			Statement stmt;
			SQLConnection conn = new  SQLConnection();
			stmt = conn.getConnection().createStatement();
			ResultSet rs= stmt.executeQuery("SELECT * FROM db1.subscriber ;");
				try {
				
						while (rs.next())
							{
							
								
								System.out.println(rs.getString(1));
							
								
							}
					
  
					}
						catch (SQLException e)
								{	
								e.printStackTrace();
								}
		}
  
		catch (Exception ex )
		{
	  ex.printStackTrace();
		}
		return "dskjfl";
	}
}
